package com.aplink.generic.constant.type;

public enum TravelMode {
	BICYCLING(3),
	DRIVING(1),
	TRANSIT(4),
	WALKING(2);

	public static TravelMode get(int key) {
		for (TravelMode directionsStatus : values()) {
			if (directionsStatus.getValue() == key) {
				return directionsStatus;
			}
		}
		return DRIVING;
	}

	public static TravelMode get(String name) {
		for (TravelMode directionsStatus : values()) {
			if (directionsStatus.name().equalsIgnoreCase(name)) {
				return directionsStatus;
			}
		}
		return DRIVING;
	}

	private int mValue;

	private TravelMode(int value) {
		setValue(value);
	}

	public int getValue() {
		return mValue;
	}

	public void setValue(int value) {
		mValue = value;
	}
}
